<?php
/*
 *  This file is part of Urd.
 *
 *  Urd is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *  Urd is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program. See the file "COPYING". If it does not
 *  exist, see <http://www.gnu.org/licenses/>.
 *
 * $LastChangedDate: 2008-06-29 19:51:21 +0200 (Sun, 29 Jun 2008) $
 * $Rev: 1238 $
 * $Author: gavinspearhead $
 * $Id: admin_tasks.php 1238 2008-06-29 17:51:21Z gavinspearhead $
 */
define('ORIGINAL_PAGE', $_SERVER['PHP_SELF']);


$pathadt = realpath(dirname(__FILE__));

require_once "$pathadt/../functions/html_includes.php";

$currentstatus = '';
$_allstatus = array (
    QUEUE_QUEUED, 
    QUEUE_FINISHED,
    QUEUE_FAILED, 
    QUEUE_RUNNING,
    QUEUE_PAUSED,
    QUEUE_CANCELLED,
    QUEUE_CRASH, 
    QUEUE_REMOVED
);

$times = array(
    0 => $LN['all'],
    1 => $LN['since'] . ' 1 ' . $LN['day'],
    2 => $LN['since'] . ' 2 ' . $LN['days'],
    7 => $LN['since'] . ' 1 ' . $LN['week'],
    14 => $LN['since'] . ' 2 ' . $LN['weeks'],
    30 => $LN['since'] . ' 1 ' . $LN['month'],
    60 => $LN['since'] . ' 2 ' . $LN['months'],
    365 => $LN['since'] . ' 1 ' . $LN['year']
);

$allstatus = array(''=>'');
foreach ($_allstatus as $s)
    $allstatus[$s] = $LN['transfers_status_' . strtolower($s)];


if (!$isadmin)
	fatal_error($LN['error_noadmin']);

$smarty->assign('menu',			generate_menu($LN));
$smarty->assign('title',	'URD - ' .	$LN['tasks_title']);
$smarty->assign('allstatus',	$allstatus);
$smarty->assign('alltimes',	$times);
$smarty->assign('currentstatus',	$currentstatus);
$smarty->display('admin_tasks.tpl');

?>
